package com.olinsports.system.olinsportssystem.controller;

import com.olinsports.system.olinsportssystem.manager.InventorySettingsManager;
import com.olinsports.system.olinsportssystem.model.InventoryDetails;
import com.olinsports.system.olinsportssystem.model.InventorySettings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/7/22.
 */
@Controller
@RequestMapping("inventorySettings")
public class InventorySettingsController {
    @Autowired
    private InventorySettingsManager inventorySettingsManager;
    @RequestMapping("/selectAll")
    @ResponseBody
    public List<InventorySettings> selectAll(){
        return inventorySettingsManager.selectAll();
    }
    @RequestMapping("/insertAll")
    @ResponseBody
    public int insertAll(InventorySettings inventorySettings){
        return inventorySettingsManager.insertAll(inventorySettings);
    }

    @RequestMapping("/deleteByKey")
    @ResponseBody
    public int deleteByKey(int detailedKey){
        return inventorySettingsManager.deleteByKey(detailedKey);
    }
    @RequestMapping("/updateData")
    @ResponseBody
    public int updateData(InventorySettings inventorySettings){
        return inventorySettingsManager.updateData(inventorySettings);
    }

    @RequestMapping("/selectByKey")
    @ResponseBody
    public InventorySettings selectByKey(int inventoryKey){
        return inventorySettingsManager.selectByKey(inventoryKey);
    }

    @RequestMapping("/listOrSearchInvent")
    @ResponseBody
    public Map listOrSearchInvent(String page, String rows, boolean _search, String sord, String sidx){
        return inventorySettingsManager.listOrSearchInvent(page,rows,_search,sord,sidx);
    }

    @RequestMapping("/saveInventorySettings")
    @ResponseBody
    public int saveInventorySettings(InventorySettings inventorySettings,int typekey) {
        return inventorySettingsManager.saveInventorySettings(inventorySettings,typekey);
    }
}
